Left Termination of the query pattern minsort_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

minsort([], []).
minsort(L, .(X, L1)) :- ','(min1(X, L), ','(remove(X, L, L2), minsort(L2, L1))).
min1(M, .(X, L)) :- min2(X, M, L).
min2(X, X, []).
min2(X, A, .(M, L)) :- ','(min(X, M, B), min2(B, A, L)).
min(X, Y, X) :- le(X, Y).
min(X, Y, Y) :- gt(X, Y).
remove(N, .(N, L), L).
remove(N, .(M, L), .(M, L1)) :- ','(notEq(N, M), remove(N, L, L1)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).
notEq(s(X), s(Y)) :- notEq(X, Y).
notEq(s(X), 0).
notEq(0, s(X)).

Queries:

minsort(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MINSORT_IN(L, .(X, L1)) → U11(L, X, L1, min1_in(X, L))
MINSORT_IN(L, .(X, L1)) → MIN1_IN(X, L)
MIN1_IN(M, .(X, L)) → U41(M, X, L, min2_in(X, M, L))
MIN1_IN(M, .(X, L)) → MIN2_IN(X, M, L)
MIN2_IN(X, A, .(M, L)) → U51(X, A, M, L, min_in(X, M, B))
MIN2_IN(X, A, .(M, L)) → MIN_IN(X, M, B)
MIN_IN(X, Y, Y) → U81(X, Y, gt_in(X, Y))
MIN_IN(X, Y, Y) → GT_IN(X, Y)
GT_IN(s(X), s(Y)) → U111(X, Y, gt_in(X, Y))
GT_IN(s(X), s(Y)) → GT_IN(X, Y)
MIN_IN(X, Y, X) → U71(X, Y, le_in(X, Y))
MIN_IN(X, Y, X) → LE_IN(X, Y)
LE_IN(s(X), s(Y)) → U121(X, Y, le_in(X, Y))
LE_IN(s(X), s(Y)) → LE_IN(X, Y)
U51(X, A, M, L, min_out(X, M, B)) → U61(X, A, M, L, min2_in(B, A, L))
U51(X, A, M, L, min_out(X, M, B)) → MIN2_IN(B, A, L)
U11(L, X, L1, min1_out(X, L)) → U21(L, X, L1, remove_in(X, L, L2))
U11(L, X, L1, min1_out(X, L)) → REMOVE_IN(X, L, L2)
REMOVE_IN(N, .(M, L), .(M, L1)) → U91(N, M, L, L1, notEq_in(N, M))
REMOVE_IN(N, .(M, L), .(M, L1)) → NOTEQ_IN(N, M)
NOTEQ_IN(s(X), s(Y)) → U131(X, Y, notEq_in(X, Y))
NOTEQ_IN(s(X), s(Y)) → NOTEQ_IN(X, Y)
U91(N, M, L, L1, notEq_out(N, M)) → U101(N, M, L, L1, remove_in(N, L, L1))
U91(N, M, L, L1, notEq_out(N, M)) → REMOVE_IN(N, L, L1)
U21(L, X, L1, remove_out(X, L, L2)) → U31(L, X, L1, minsort_in(L2, L1))
U21(L, X, L1, remove_out(X, L, L2)) → MINSORT_IN(L2, L1)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
MINSORT_IN(x1, x2)  =  MINSORT_IN(x1)
MIN2_IN(x1, x2, x3)  =  MIN2_IN(x1, x3)
U111(x1, x2, x3)  =  U111(x3)
U71(x1, x2, x3)  =  U71(x1, x3)
U131(x1, x2, x3)  =  U131(x3)
U41(x1, x2, x3, x4)  =  U41(x4)
U81(x1, x2, x3)  =  U81(x2, x3)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x2, x3, x5)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
U61(x1, x2, x3, x4, x5)  =  U61(x5)
LE_IN(x1, x2)  =  LE_IN(x1, x2)
U101(x1, x2, x3, x4, x5)  =  U101(x2, x5)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U51(x1, x2, x3, x4, x5)  =  U51(x4, x5)
MIN_IN(x1, x2, x3)  =  MIN_IN(x1, x2)
REMOVE_IN(x1, x2, x3)  =  REMOVE_IN(x1, x2)
U121(x1, x2, x3)  =  U121(x3)
NOTEQ_IN(x1, x2)  =  NOTEQ_IN(x1, x2)
MIN1_IN(x1, x2)  =  MIN1_IN(x2)
GT_IN(x1, x2)  =  GT_IN(x1, x2)
U11(x1, x2, x3, x4)  =  U11(x1, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

MINSORT_IN(L, .(X, L1)) → U11(L, X, L1, min1_in(X, L))
MINSORT_IN(L, .(X, L1)) → MIN1_IN(X, L)
MIN1_IN(M, .(X, L)) → U41(M, X, L, min2_in(X, M, L))
MIN1_IN(M, .(X, L)) → MIN2_IN(X, M, L)
MIN2_IN(X, A, .(M, L)) → U51(X, A, M, L, min_in(X, M, B))
MIN2_IN(X, A, .(M, L)) → MIN_IN(X, M, B)
MIN_IN(X, Y, Y) → U81(X, Y, gt_in(X, Y))
MIN_IN(X, Y, Y) → GT_IN(X, Y)
GT_IN(s(X), s(Y)) → U111(X, Y, gt_in(X, Y))
GT_IN(s(X), s(Y)) → GT_IN(X, Y)
MIN_IN(X, Y, X) → U71(X, Y, le_in(X, Y))
MIN_IN(X, Y, X) → LE_IN(X, Y)
LE_IN(s(X), s(Y)) → U121(X, Y, le_in(X, Y))
LE_IN(s(X), s(Y)) → LE_IN(X, Y)
U51(X, A, M, L, min_out(X, M, B)) → U61(X, A, M, L, min2_in(B, A, L))
U51(X, A, M, L, min_out(X, M, B)) → MIN2_IN(B, A, L)
U11(L, X, L1, min1_out(X, L)) → U21(L, X, L1, remove_in(X, L, L2))
U11(L, X, L1, min1_out(X, L)) → REMOVE_IN(X, L, L2)
REMOVE_IN(N, .(M, L), .(M, L1)) → U91(N, M, L, L1, notEq_in(N, M))
REMOVE_IN(N, .(M, L), .(M, L1)) → NOTEQ_IN(N, M)
NOTEQ_IN(s(X), s(Y)) → U131(X, Y, notEq_in(X, Y))
NOTEQ_IN(s(X), s(Y)) → NOTEQ_IN(X, Y)
U91(N, M, L, L1, notEq_out(N, M)) → U101(N, M, L, L1, remove_in(N, L, L1))
U91(N, M, L, L1, notEq_out(N, M)) → REMOVE_IN(N, L, L1)
U21(L, X, L1, remove_out(X, L, L2)) → U31(L, X, L1, minsort_in(L2, L1))
U21(L, X, L1, remove_out(X, L, L2)) → MINSORT_IN(L2, L1)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
MINSORT_IN(x1, x2)  =  MINSORT_IN(x1)
MIN2_IN(x1, x2, x3)  =  MIN2_IN(x1, x3)
U111(x1, x2, x3)  =  U111(x3)
U71(x1, x2, x3)  =  U71(x1, x3)
U131(x1, x2, x3)  =  U131(x3)
U41(x1, x2, x3, x4)  =  U41(x4)
U81(x1, x2, x3)  =  U81(x2, x3)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x2, x3, x5)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
U61(x1, x2, x3, x4, x5)  =  U61(x5)
LE_IN(x1, x2)  =  LE_IN(x1, x2)
U101(x1, x2, x3, x4, x5)  =  U101(x2, x5)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
U51(x1, x2, x3, x4, x5)  =  U51(x4, x5)
MIN_IN(x1, x2, x3)  =  MIN_IN(x1, x2)
REMOVE_IN(x1, x2, x3)  =  REMOVE_IN(x1, x2)
U121(x1, x2, x3)  =  U121(x3)
NOTEQ_IN(x1, x2)  =  NOTEQ_IN(x1, x2)
MIN1_IN(x1, x2)  =  MIN1_IN(x2)
GT_IN(x1, x2)  =  GT_IN(x1, x2)
U11(x1, x2, x3, x4)  =  U11(x1, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 6 SCCs with 16 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NOTEQ_IN(s(X), s(Y)) → NOTEQ_IN(X, Y)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
NOTEQ_IN(x1, x2)  =  NOTEQ_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NOTEQ_IN(s(X), s(Y)) → NOTEQ_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

NOTEQ_IN(s(X), s(Y)) → NOTEQ_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REMOVE_IN(N, .(M, L), .(M, L1)) → U91(N, M, L, L1, notEq_in(N, M))
U91(N, M, L, L1, notEq_out(N, M)) → REMOVE_IN(N, L, L1)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x2, x3, x5)
REMOVE_IN(x1, x2, x3)  =  REMOVE_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REMOVE_IN(N, .(M, L), .(M, L1)) → U91(N, M, L, L1, notEq_in(N, M))
U91(N, M, L, L1, notEq_out(N, M)) → REMOVE_IN(N, L, L1)

The TRS R consists of the following rules:

notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
0  =  0
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x2, x3, x5)
REMOVE_IN(x1, x2, x3)  =  REMOVE_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

REMOVE_IN(N, .(M, L)) → U91(N, M, L, notEq_in(N, M))
U91(N, M, L, notEq_out) → REMOVE_IN(N, L)

The TRS R consists of the following rules:

notEq_in(0, s(X)) → notEq_out
notEq_in(s(X), 0) → notEq_out
notEq_in(s(X), s(Y)) → U13(notEq_in(X, Y))
U13(notEq_out) → notEq_out

The set Q consists of the following terms:

notEq_in(x0, x1)
U13(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
LE_IN(x1, x2)  =  LE_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
GT_IN(x1, x2)  =  GT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MIN2_IN(X, A, .(M, L)) → U51(X, A, M, L, min_in(X, M, B))
U51(X, A, M, L, min_out(X, M, B)) → MIN2_IN(B, A, L)

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
MIN2_IN(x1, x2, x3)  =  MIN2_IN(x1, x3)
U51(x1, x2, x3, x4, x5)  =  U51(x4, x5)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MIN2_IN(X, A, .(M, L)) → U51(X, A, M, L, min_in(X, M, B))
U51(X, A, M, L, min_out(X, M, B)) → MIN2_IN(B, A, L)

The TRS R consists of the following rules:

min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
MIN2_IN(x1, x2, x3)  =  MIN2_IN(x1, x3)
U51(x1, x2, x3, x4, x5)  =  U51(x4, x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U51(L, min_out(B)) → MIN2_IN(B, L)
MIN2_IN(X, .(M, L)) → U51(L, min_in(X, M))

The TRS R consists of the following rules:

min_in(X, Y) → U8(Y, gt_in(X, Y))
min_in(X, Y) → U7(X, le_in(X, Y))
U8(Y, gt_out) → min_out(Y)
U7(X, le_out) → min_out(X)
gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U11(gt_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U12(le_in(X, Y))
U11(gt_out) → gt_out
U12(le_out) → le_out

The set Q consists of the following terms:

min_in(x0, x1)
U8(x0, x1)
U7(x0, x1)
gt_in(x0, x1)
le_in(x0, x1)
U11(x0)
U12(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U21(L, X, L1, remove_out(X, L, L2)) → MINSORT_IN(L2, L1)
MINSORT_IN(L, .(X, L1)) → U11(L, X, L1, min1_in(X, L))
U11(L, X, L1, min1_out(X, L)) → U21(L, X, L1, remove_in(X, L, L2))

The TRS R consists of the following rules:

minsort_in(L, .(X, L1)) → U1(L, X, L1, min1_in(X, L))
min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
min2_in(X, X, []) → min2_out(X, X, [])
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U1(L, X, L1, min1_out(X, L)) → U2(L, X, L1, remove_in(X, L, L2))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U2(L, X, L1, remove_out(X, L, L2)) → U3(L, X, L1, minsort_in(L2, L1))
minsort_in([], []) → minsort_out([], [])
U3(L, X, L1, minsort_out(L2, L1)) → minsort_out(L, .(X, L1))

The argument filtering Pi contains the following mapping:
minsort_in(x1, x2)  =  minsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
U2(x1, x2, x3, x4)  =  U2(x2, x4)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
minsort_out(x1, x2)  =  minsort_out(x2)
MINSORT_IN(x1, x2)  =  MINSORT_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U21(L, X, L1, remove_out(X, L, L2)) → MINSORT_IN(L2, L1)
MINSORT_IN(L, .(X, L1)) → U11(L, X, L1, min1_in(X, L))
U11(L, X, L1, min1_out(X, L)) → U21(L, X, L1, remove_in(X, L, L2))

The TRS R consists of the following rules:

min1_in(M, .(X, L)) → U4(M, X, L, min2_in(X, M, L))
remove_in(N, .(M, L), .(M, L1)) → U9(N, M, L, L1, notEq_in(N, M))
remove_in(N, .(N, L), L) → remove_out(N, .(N, L), L)
U4(M, X, L, min2_out(X, M, L)) → min1_out(M, .(X, L))
U9(N, M, L, L1, notEq_out(N, M)) → U10(N, M, L, L1, remove_in(N, L, L1))
min2_in(X, A, .(M, L)) → U5(X, A, M, L, min_in(X, M, B))
min2_in(X, X, []) → min2_out(X, X, [])
notEq_in(0, s(X)) → notEq_out(0, s(X))
notEq_in(s(X), 0) → notEq_out(s(X), 0)
notEq_in(s(X), s(Y)) → U13(X, Y, notEq_in(X, Y))
U10(N, M, L, L1, remove_out(N, L, L1)) → remove_out(N, .(M, L), .(M, L1))
U5(X, A, M, L, min_out(X, M, B)) → U6(X, A, M, L, min2_in(B, A, L))
U13(X, Y, notEq_out(X, Y)) → notEq_out(s(X), s(Y))
min_in(X, Y, Y) → U8(X, Y, gt_in(X, Y))
min_in(X, Y, X) → U7(X, Y, le_in(X, Y))
U6(X, A, M, L, min2_out(B, A, L)) → min2_out(X, A, .(M, L))
U8(X, Y, gt_out(X, Y)) → min_out(X, Y, Y)
U7(X, Y, le_out(X, Y)) → min_out(X, Y, X)
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U11(X, Y, gt_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U12(X, Y, le_in(X, Y))
U11(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U12(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
min1_in(x1, x2)  =  min1_in(x2)
U4(x1, x2, x3, x4)  =  U4(x4)
min2_in(x1, x2, x3)  =  min2_in(x1, x3)
U5(x1, x2, x3, x4, x5)  =  U5(x4, x5)
min_in(x1, x2, x3)  =  min_in(x1, x2)
U8(x1, x2, x3)  =  U8(x2, x3)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U11(x1, x2, x3)  =  U11(x3)
min_out(x1, x2, x3)  =  min_out(x3)
U7(x1, x2, x3)  =  U7(x1, x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U12(x1, x2, x3)  =  U12(x3)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
[]  =  []
min2_out(x1, x2, x3)  =  min2_out(x2)
min1_out(x1, x2)  =  min1_out(x1)
remove_in(x1, x2, x3)  =  remove_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x2, x3, x5)
notEq_in(x1, x2)  =  notEq_in(x1, x2)
notEq_out(x1, x2)  =  notEq_out
U13(x1, x2, x3)  =  U13(x3)
U10(x1, x2, x3, x4, x5)  =  U10(x2, x5)
remove_out(x1, x2, x3)  =  remove_out(x3)
MINSORT_IN(x1, x2)  =  MINSORT_IN(x1)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
U11(x1, x2, x3, x4)  =  U11(x1, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U21(X, remove_out(L2)) → MINSORT_IN(L2)
U11(L, min1_out(X)) → U21(X, remove_in(X, L))
MINSORT_IN(L) → U11(L, min1_in(L))

The TRS R consists of the following rules:

min1_in(.(X, L)) → U4(min2_in(X, L))
remove_in(N, .(M, L)) → U9(N, M, L, notEq_in(N, M))
remove_in(N, .(N, L)) → remove_out(L)
U4(min2_out(M)) → min1_out(M)
U9(N, M, L, notEq_out) → U10(M, remove_in(N, L))
min2_in(X, .(M, L)) → U5(L, min_in(X, M))
min2_in(X, []) → min2_out(X)
notEq_in(0, s(X)) → notEq_out
notEq_in(s(X), 0) → notEq_out
notEq_in(s(X), s(Y)) → U13(notEq_in(X, Y))
U10(M, remove_out(L1)) → remove_out(.(M, L1))
U5(L, min_out(B)) → U6(min2_in(B, L))
U13(notEq_out) → notEq_out
min_in(X, Y) → U8(Y, gt_in(X, Y))
min_in(X, Y) → U7(X, le_in(X, Y))
U6(min2_out(A)) → min2_out(A)
U8(Y, gt_out) → min_out(Y)
U7(X, le_out) → min_out(X)
gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U11(gt_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U12(le_in(X, Y))
U11(gt_out) → gt_out
U12(le_out) → le_out

The set Q consists of the following terms:

min1_in(x0)
remove_in(x0, x1)
U4(x0)
U9(x0, x1, x2, x3)
min2_in(x0, x1)
notEq_in(x0, x1)
U10(x0, x1)
U5(x0, x1)
U13(x0)
min_in(x0, x1)
U6(x0)
U8(x0, x1)
U7(x0, x1)
gt_in(x0, x1)
le_in(x0, x1)
U11(x0)
U12(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U21(X, remove_out(L2)) → MINSORT_IN(L2)
The remaining pairs can at least be oriented weakly.

U11(L, min1_out(X)) → U21(X, remove_in(X, L))
MINSORT_IN(L) → U11(L, min1_in(L))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x1 + x2   
POL(0) = 1   
POL(MINSORT_IN(x1)) = 1 + x1   
POL(U10(x1, x2)) = 1 + x1 + x2   
POL(U11(x1)) = 0   
POL(U12(x1)) = x1   
POL(U13(x1)) = 0   
POL(U11(x1, x2)) = 1 + x1   
POL(U21(x1, x2)) = 1 + x2   
POL(U4(x1)) = 0   
POL(U5(x1, x2)) = 0   
POL(U6(x1)) = 0   
POL(U7(x1, x2)) = 0   
POL(U8(x1, x2)) = 1   
POL(U9(x1, x2, x3, x4)) = 1 + x2 + x3   
POL([]) = 0   
POL(gt_in(x1, x2)) = 0   
POL(gt_out) = 0   
POL(le_in(x1, x2)) = x1 + x2   
POL(le_out) = 1   
POL(min1_in(x1)) = 0   
POL(min1_out(x1)) = 0   
POL(min2_in(x1, x2)) = 0   
POL(min2_out(x1)) = 0   
POL(min_in(x1, x2)) = 1 + x1 + x2   
POL(min_out(x1)) = 0   
POL(notEq_in(x1, x2)) = x1   
POL(notEq_out) = 0   
POL(remove_in(x1, x2)) = x2   
POL(remove_out(x1)) = 1 + x1   
POL(s(x1)) = x1   

The following usable rules [17] were oriented:

U10(M, remove_out(L1)) → remove_out(.(M, L1))
remove_in(N, .(M, L)) → U9(N, M, L, notEq_in(N, M))
remove_in(N, .(N, L)) → remove_out(L)
U9(N, M, L, notEq_out) → U10(M, remove_in(N, L))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U11(L, min1_out(X)) → U21(X, remove_in(X, L))
MINSORT_IN(L) → U11(L, min1_in(L))

The TRS R consists of the following rules:

min1_in(.(X, L)) → U4(min2_in(X, L))
remove_in(N, .(M, L)) → U9(N, M, L, notEq_in(N, M))
remove_in(N, .(N, L)) → remove_out(L)
U4(min2_out(M)) → min1_out(M)
U9(N, M, L, notEq_out) → U10(M, remove_in(N, L))
min2_in(X, .(M, L)) → U5(L, min_in(X, M))
min2_in(X, []) → min2_out(X)
notEq_in(0, s(X)) → notEq_out
notEq_in(s(X), 0) → notEq_out
notEq_in(s(X), s(Y)) → U13(notEq_in(X, Y))
U10(M, remove_out(L1)) → remove_out(.(M, L1))
U5(L, min_out(B)) → U6(min2_in(B, L))
U13(notEq_out) → notEq_out
min_in(X, Y) → U8(Y, gt_in(X, Y))
min_in(X, Y) → U7(X, le_in(X, Y))
U6(min2_out(A)) → min2_out(A)
U8(Y, gt_out) → min_out(Y)
U7(X, le_out) → min_out(X)
gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U11(gt_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U12(le_in(X, Y))
U11(gt_out) → gt_out
U12(le_out) → le_out

The set Q consists of the following terms:

min1_in(x0)
remove_in(x0, x1)
U4(x0)
U9(x0, x1, x2, x3)
min2_in(x0, x1)
notEq_in(x0, x1)
U10(x0, x1)
U5(x0, x1)
U13(x0)
min_in(x0, x1)
U6(x0)
U8(x0, x1)
U7(x0, x1)
gt_in(x0, x1)
le_in(x0, x1)
U11(x0)
U12(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.